package com.mes.biz.service.impl;

import java.util.List;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.pagehelper.PageInfo;
import com.mes.common.core.domain.BaseEntity;
import com.mes.common.core.service.BaseServiceImpl;
import com.mes.biz.mapper.BizWarehouseSpaceMapper;
import com.mes.biz.domain.BizWarehouseSpace;
import com.mes.biz.service.BizWarehouseSpaceService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 仓位管理Service业务层处理
 * @author hwg
 * @email hwg
 * @date 2023-04-09
 */
@Service
@Transactional(readOnly = true)
public class BizWarehouseSpaceServiceImpl extends BaseServiceImpl<BizWarehouseSpaceMapper, BizWarehouseSpace> implements BizWarehouseSpaceService {

    private static final Logger log = LoggerFactory.getLogger(BizWarehouseSpaceServiceImpl.class);

    /**
     * 获取单条数据
     * @param bizWarehouseSpace 仓位管理
     * @return 仓位管理
     */
    @Override
    public BizWarehouseSpace get(BizWarehouseSpace bizWarehouseSpace) {
        BizWarehouseSpace dto = super.get(bizWarehouseSpace);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 仓位管理id
     * @return 仓位管理
     */
    @Override
    public BizWarehouseSpace get(String id) {
        BizWarehouseSpace dto = super.get(id);
        return dto;
    }

    /**
     * 查询仓位管理列表
     * @param bizWarehouseSpace 仓位管理
     * @return 仓位管理
     */
    @Override
    public List<BizWarehouseSpace> findList(BizWarehouseSpace bizWarehouseSpace) {
        List<BizWarehouseSpace> bizWarehouseSpaceList = super.findList(bizWarehouseSpace);
        return bizWarehouseSpaceList;
    }

    /**
     * 分页查询仓位管理列表
     * @param bizWarehouseSpace 仓位管理
     * @return 仓位管理
     */
    @Override
    public PageInfo<BizWarehouseSpace> findPage(BizWarehouseSpace bizWarehouseSpace) {
        PageInfo<BizWarehouseSpace> page = super.findPage(bizWarehouseSpace);
        return page;
    }

    /**
     * 保存仓位管理
     * @param bizWarehouseSpace
     * @return 结果
     */
    @Override
    public boolean save(BizWarehouseSpace bizWarehouseSpace) {
        return super.save(bizWarehouseSpace);
    }

    /**
     * 删除仓位管理信息
     * @param bizWarehouseSpace
     * @return 结果
     */
    @Override
    public boolean remove(BizWarehouseSpace bizWarehouseSpace) {
        return super.remove(bizWarehouseSpace);
    }

    /**
     * 批量删除仓位管理
     * @param ids 需要删除的仓位管理ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteBizWarehouseSpaceByIds(String[] ids) {
        return mapper.deleteBizWarehouseSpaceByIds(ids, BaseEntity.DEL_FLAG_DELETE);
    }

    @Override
    public List<BizWarehouseSpace> spaceList(String warehouseId, String productId) {
        return mapper.spaceList(warehouseId, productId);
    }

    @Override
    public BizWarehouseSpace getSpaceIdBySpaceWithWarehouseId(String warehouseId, String postion) {
        return  mapper.getSpaceIdBySpaceWithWarehouseId(warehouseId,postion);
    }

}
